package com.xjggb.demo.config;


import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectRabbitMqConfiguration {


   /* *//*
    * 声明注册fanoyut模式交换机
    * *//*
    @Bean
    public DirectExchange directExchange(){
   return new DirectExchange("direct_order_exchange",true,false);
    }

    *//*
    * 声明队列
    * *//*
    @Bean
    public Queue smsQueue(){

       return new Queue("sms.Direct.queue",true);
    }


    @Bean
    public Queue emailQueue(){

        return new Queue("emailQueue.Direct.queue",true);
    }
    @Bean
    public Queue duanxinQueue(){

        return new Queue("duanxinQueue.Direct.queue",true);
    }


    *//*
    * 完成绑定关系
    * *//*
    @Bean
    public Binding smsBinding(){
   return BindingBuilder.bind(smsQueue()).to(directExchange()).with("sms");  //with添加路由key
    }

    @Bean
    public Binding emailBinding(){
        return BindingBuilder.bind(emailQueue()).to(directExchange()).with("email");
    }
    @Bean
    public Binding duanxinBinding(){
        return BindingBuilder.bind(duanxinQueue()).to(directExchange()).with("dunxin");
    }
*/
}
